﻿@using ContractorTimesheet.DataModel
@using ContractorTimesheet.Infrastructure

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>My Timesheet</title>
    <style scoped="scoped">
        input.error {
            border: 1px solid gray;
            background-color: #FDC;
        }

        label.error {
            color: Red;
            font-size: 0.8em;
        }

        div.error {
            visibility: hidden;
            display: none;
        }
    </style>

    <script src="@Url.Content("~/Scripts/jquery-2.1.1.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/jquery.form.min.js")" typ type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/knockout-3.2.0.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/knockout.mapping-latest.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/perpetuum.knockout.js")" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/json2.min.js")" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/jquery.zclip.min.js")" type="text/javascript"></script>

    @*@Scripts.Render("~/bundles/knockout")*@

    @Scripts.Render("~/bundles/bootstrap")
    @Styles.Render("~/Content/css")
    @Scripts.Render("~/bundles/modernizr")

    @{

        User loginUser = CurrentSession.User;
    }

</head>
<body>
    <div class="navbar navbar-inverse navbar-fixed-top">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                @Html.ActionLink("Dashboard", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
            </div>
            <div class="navbar-collapse collapse">
                <ul class="nav navbar-nav">
                    <li>@Html.ActionLink("Leaves", "Index", "Leaves")</li>
                    <li>@Html.ActionLink("Holidays", "Index", "Holidays")</li>
                    <li>@Html.ActionLink("Contractors", "Index", "Users")</li>
                    @if (loginUser == null)
                    {
                        <li> @Html.ActionLink("Login", "Login", "Home")</li>
                    }
                    else
                    {
                        if (loginUser.IsAdmin)
                        {
                            <li> @Html.ActionLink("Reset Password", "Index", "ResetPassword")</li>
                        }
                        
                        <li> @Html.ActionLink("Change Password", "Index", "ChangePassword")</li>
                        <li> @Html.ActionLink("Logout", "Logout", "Home")</li>
                    }
                </ul>
                @if (loginUser != null)
                {
                    <p class="nav navbar-text navbar-right">Hello, @loginUser.Firstname !</p>
                }
            </div>
        </div>
    </div>
    <div class="container body-content">

        @RenderBody()

        @*<footer align="center" style="position: fixed; bottom: 0px; height: 100px;width:inherit">
            <hr />
            <p>&copy; @DateTime.Now.Year</p>
        </footer>*@
    </div>

    @RenderSection("scripts", required: false)

</body>
</html>
